<template>
  <div class="app">
    <dl>
      <dt>
        <img :src="tosrc(item.src)" alt="" style="width: 100%; height: 100%" />
      </dt>
      <dd>
        <p class="nump">
        <span v-if="item.flag" style="font-size: 14px;">￥</span>{{ item.num  }}</p>
        <p style="font-size: 14px;color: #303849;">{{ item.daytext }}</p>
      </dd>
    </dl>
    <p>日同比
        <span class="updown" >增高20%</span>
        <img v-if="item.upordown" style="width: 14px;height: 14px;position: relative;top: 2.5px;" src="@/assets/Icons/png/上升.png" alt="">
        <img v-else style="width: 14px;height: 14px;position: relative;top: 2.5px;" src="@/assets/Icons/png/下降.png" alt="">
    </p>
  </div>
</template>

<script setup lang="ts">
import {ref, toRefs} from "vue"
const tosrc = (url: any)=>{
    return new URL(url,import.meta.url).href
}
const props:any = defineProps({
    item:{}
})
const {item} = toRefs(props)

let NumColor= ref('')
let UpDownColor=ref('')
NumColor.value = item.value.numcolor
UpDownColor.value =item.value.UpDownColor
</script>


<style scoped>
.nump{
    font-size: 26px;
    color: v-bind(NumColor);
    margin: 22px 0 0 14px;
}
.updown{
    color: v-bind(UpDownColor);
}
.app {
  width: 237px;
  height: 130px;
  background-color: #ffffff;
  box-shadow: 0px 0px 10px 0px rgba(51, 51, 51, 0.1);
  border-radius: 8px;
  margin-left: 10px;
  display: inline-block;
}

.app dl dt {
  margin-left: 20px;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  float: left;
}
.app dl {
  clear: both;
}
.app dl dd p{
    text-align: right;padding-right: 20px;
}
.app>p{
    border-top: 1px solid rgba(178, 183, 198, 0.5);
    clear: both;
    margin-top: 15px;
    padding-top: 10px;
    padding-left: 20px;
    font-size: 12px;
    
}
</style>
